<extend name="Public/base"/>
  
<block name="body">
               <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>           
                        <form class="form-horizontal" role="form" action="{:U('Goods/edit')}" method="post" enctype="multipart/form-data">
                          	<div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1">商品名称<span style="color:#f00;">*</span></label>
                                <div class="col-sm-9"><input class="col-sm-12 form-control" id="title" type="text" name="name" value="{$goods['name']}"></div>
                            </div>
                           
                           <div class="form-group">
	                          <label class="col-sm-2 control-label no-padding-right" for="form-field-1">商品图片<span style="color:#f00;">*</span></label>
							  <div class="col-sm-9">
									<input type="file" id="upload_picture_pic_url">
									
									<div class="upload-img-box">
									<notempty name="goods.pic_url">
										<div class="upload-pre-item"><img src="{$goods[pic_url]}"/></div>
									</notempty>
									</div>
							  </div>	
								<script type="text/javascript">
								//上传图片
							    /* 初始化上传插件 */
								$("#upload_picture_pic_url").uploadify({
							        "height"          : 30,
							        "swf"             : "__STATIC__/uploadify/uploadify.swf",
							        "fileObjName"     : "download",
							        "buttonText"      : "上传图片",
							        "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
							        "width"           : 120,
							        
							        "removeTimeout"	  : 1,
							        "fileTypeExts"	  : "*.jpg; *.png; *.gif;",
							        "onUploadSuccess" : uploadPicture,
							        "onFallback" : function() {
							            alert('未检测到兼容版本的Flash.');
							        }
							    });
								function uploadPicture(file, data){
							    	var data = $.parseJSON(data);
							    	var src = '';
							    	
							        if(data.status){
							        	
							        	$("#pic_url").val(data.path);
							        	src = data.url || '__ROOT__' + data.path
							        	$("#pic_url").parent().find('.upload-img-box').html(
							        		'<div class="upload-pre-item"><img src="' + src + '"/></div>'
							        	);
							        } else {
							        	updateAlert(data.info);
							        	setTimeout(function(){
							                $('#top-alert').find('button').click();
							                $(that).removeClass('disabled').prop('disabled',false);
							            },1500);
							        }
							    }
								</script>
							</div>
                           <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1">远程图片<span style="color:#f00;"></span></label>
                                <div class="col-sm-9">
                                	<input class="col-sm-12 form-control" type="text" id="pic_url" name="pic_url" id="pic_url" placeholder="上传图片与远程图片选其一" value="{$goods[pic_url]}"/>
                                </div>
                            </div>
                            
                            
                            

                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">卖家名称</label>	
                                <div class="col-sm-9"><input class="col-sm-12 form-control" type="text" id="nick"name="nick" value="{$goods['nick']}"></div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">seo标题</label>	
                                <div class="col-sm-9"><input class="col-sm-12 form-control" id="seo_title" type="text" name="seo_title" value="{$goods['seo_title']}"></div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">seo关键字</label>	
                                <div class="col-sm-9"><input class="col-sm-12 form-control" type="text" name="seo_keywords" value="{$goods['seo_keywords']}"></div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">seo内容</label>	
                                <div class="col-sm-9"><input class="col-sm-12 form-control" type="text" name="seo_description" value="{$goods['seo_description']}"></div>
                            </div>

                           

                          
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">兑换积分<span style="color:#f00;">*</span></label>	
                                <div class="col-sm-9"><input class="col-sm-12 form-control" type="text" id="price" name="price" value="{$goods['price']}" placeholder="兑换所需的积分"></div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">商品介绍 </label>

                                <div class="col-sm-9">
                                    <textarea class="col-sm-12" name="item_body" style="height:500px;visibility:hidden;">{:stripslashes($goods['item_body'])}</textarea>
                                    {:hook('adminArticleEdit', array('name'=>'item_body','value'=>$goods['item_body']))}
                                </div>
                            </div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-4 col-md-4">
                                    <input type="hidden" name="id" value="{$goods.id}">
                                    <button class="btn btn-info btn-block ajax-post" target-form="form-horizontal" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        确认
                                    </button>
                                </div>
                            </div>
                        </form>
                     
   
 </block>
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div><!-- /.main-container -->
<block name="script">
	<script>
    $(function(){
        highlight_subnav("{:U('PointsMall/edit')}");
    });
    

</script>
</block>

